//
//  NetworkTools.h
//  测试-04-封装AFN框架
//
//  Created by male on 15/10/15.
//  Copyright © 2015年 itheima. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>

/// 网络请求枚举
typedef enum : NSUInteger {
    GET,
    POST,
} HMRequestMethod;

typedef void(^finishedBlock)(id result, NSError *error);
@interface NetworkTools : AFHTTPSessionManager
@property (nonatomic,strong) NSURL * url;

// 单例
+ (instancetype)sharedTools;

// MARK: 微博数据方法
-(void)loadStatusfinished:(finishedBlock)finished;

// MARK: 用户相关方法
-(void)loadUserInfoUid:(NSString *)uid accessToken:(NSString*)accessToken finished:(finishedBlock)finished;

// MARK: - OAuth相关方法
-(void)loadAccessToken:(NSString*)code finished:(finishedBlock)finished ;

//  MARK: - 网络请求方法
- (void)request:(HMRequestMethod)method URLString:(NSString *)URLString parameters:(id)parameters finished:(void (^)(id result, NSError *error))finished;

@end
